{{Extend "layout"}}
{{Block "title"}}
{{if HasSuffix $.URL.Path "_add"}}{{"添加分组"|$.T}}{{else}}{{"修改分组"|$.T}}{{end}}
{{/Block}}
{{Block "breadcrumb"}} 
{{Super}}
<li>
  <a href="{{BackendURL}}/task/group">{{"任务分组"|$.T}}</a>
</li>
<li class="active">{{if HasSuffix $.URL.Path "_add"}}{{"添加"|$.T}}{{else}}{{"修改"|$.T}}{{end}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
  <div class="col-md-12">
    <div class="block-flat no-padding">
      <div class="header">
        <h3>{{if HasSuffix $.URL.Path "_add"}}{{"添加分组"|$.T}}{{else}}{{"修改分组"|$.T}}{{end}}</h3>
      </div>
      <div class="content">
        <form class="form-horizontal group-border-dashed" method="POST" action="">
          <div class="form-group">
            <label class="col-sm-2 control-label">{{"组名称"|$.T}}</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" required name="name" value="{{$.Form "name"}}">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">{{"命令修饰"|$.T}}</label>
            <div class="col-sm-8">
              <div class="row no-margin-top">
                <div class="col-sm-6">
                  <div class="input-group">
                    <span class="input-group-addon">{{"前缀"|$.T}}</span>
                    <input type="text" class="form-control" name="cmdPrefix" id="cmdPrefix" value="{{$.Form "cmdPrefix"}}">
                  </div>
                </div>
                <div class="col-sm-6">
                  <div class="input-group">
                    <span class="input-group-addon">{{"后缀"|$.T}}</span>
                    <input type="text" class="form-control" name="cmdSuffix" id="cmdSuffix" value="{{$.Form "cmdSuffix"}}">
                  </div>
                </div>
              </div>
              <div class="help-block">
                {{"如果设置，则该组下的所有命令在执行的时候都会自动添加上此处设置的前缀和后缀。"|$.T}}<br />
                {{"比如在Linux我们希望本组内的所有任务都以用户“www”的身份去执行，可以在上面的“前缀”输入框填写："|$.T}}<a href="javascript:;" onclick="$('#cmdPrefix').val('sudo -u www');" title="{{"点击插入到输入框"|$.T}}" data-toggle="tooltip"><em style="color:green">sudo -u www</em></a>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">{{"说明"|$.T}}</label>
            <div class="col-sm-8">
              <textarea class="form-control" name="description">{{$.Form "description"}}</textarea>
            </div>
          </div>
          <div class="form-group form-submit-group">
            <div class="col-sm-9 col-sm-offset-2">
              <button type="submit" class="btn btn-primary btn-lg">
                <i class="fa fa-save"></i> {{"保存"|$.T}}</button>
              <button type="reset" class="btn btn-default btn-lg">
                <i class="fa fa-refresh"></i> {{"重置"|$.T}}</button>
            </div>
          </div>
        </form>
      </div>
      <!-- /.content -->
    </div>
    <!-- /.block-flat -->
  </div>
</div>
{{/Block}}